package com.example.hospital.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * 
 * @TableName prescription
 */
@TableName(value ="prescription")
public class Prescription implements Serializable {
    /**
     * 
     */
    @TableId(value = "prescription_id", type = IdType.AUTO)
    private Integer prescriptionId;

    /**
     * 
     */
    @TableField(value = "patient_id")
    private Integer patientId;

    /**
     * 
     */
    @TableField(value = "doctor_id")
    private Integer doctorId;

    /**
     * 
     */
    @TableField(value = "prescription_date")
    private LocalDate prescriptionDate;

    /**
     * 
     */
    @TableField(value = "medications")
    private String medications;

    /**
     * 
     */
    @TableField(value = "status")
    private String status;

    /**
     * 
     */
    @TableField(value = "medicalrecord_id")
    private Integer medicalrecordId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getPrescriptionId() {
        return prescriptionId;
    }

    /**
     * 
     */
    public void setPrescriptionId(Integer prescriptionId) {
        this.prescriptionId = prescriptionId;
    }

    /**
     * 
     */
    public Integer getPatientId() {
        return patientId;
    }

    /**
     * 
     */
    public void setPatientId(Integer patientId) {
        this.patientId = patientId;
    }

    /**
     * 
     */
    public Integer getDoctorId() {
        return doctorId;
    }

    /**
     * 
     */
    public void setDoctorId(Integer doctorId) {
        this.doctorId = doctorId;
    }

    /**
     * 
     */
    public LocalDate getPrescriptionDate() {
        return prescriptionDate;
    }

    /**
     * 
     */
    public void setPrescriptionDate(LocalDate prescriptionDate) {
        this.prescriptionDate = prescriptionDate;
    }

    /**
     * 
     */
    public String getMedications() {
        return medications;
    }

    /**
     * 
     */
    public void setMedications(String medications) {
        this.medications = medications;
    }

    /**
     * 
     */
    public String getStatus() {
        return status;
    }

    /**
     * 
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * 
     */
    public Integer getMedicalrecordId() {
        return medicalrecordId;
    }

    /**
     * 
     */
    public void setMedicalrecordId(Integer medicalrecordId) {
        this.medicalrecordId = medicalrecordId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Prescription other = (Prescription) that;
        return (this.getPrescriptionId() == null ? other.getPrescriptionId() == null : this.getPrescriptionId().equals(other.getPrescriptionId()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getDoctorId() == null ? other.getDoctorId() == null : this.getDoctorId().equals(other.getDoctorId()))
            && (this.getPrescriptionDate() == null ? other.getPrescriptionDate() == null : this.getPrescriptionDate().equals(other.getPrescriptionDate()))
            && (this.getMedications() == null ? other.getMedications() == null : this.getMedications().equals(other.getMedications()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getMedicalrecordId() == null ? other.getMedicalrecordId() == null : this.getMedicalrecordId().equals(other.getMedicalrecordId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPrescriptionId() == null) ? 0 : getPrescriptionId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getDoctorId() == null) ? 0 : getDoctorId().hashCode());
        result = prime * result + ((getPrescriptionDate() == null) ? 0 : getPrescriptionDate().hashCode());
        result = prime * result + ((getMedications() == null) ? 0 : getMedications().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getMedicalrecordId() == null) ? 0 : getMedicalrecordId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", prescriptionId=").append(prescriptionId);
        sb.append(", patientId=").append(patientId);
        sb.append(", doctorId=").append(doctorId);
        sb.append(", prescriptionDate=").append(prescriptionDate);
        sb.append(", medications=").append(medications);
        sb.append(", status=").append(status);
        sb.append(", medicalrecordId=").append(medicalrecordId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}